home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / ksslkeygen.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  2.5 KB  |  96 lines

  1. /* This file is part of the KDE project
  2.  *
  3.  * Copyright (C) 2001 George Staikos <staikos@kde.org>
  4.  *
  5.  * This library is free software; you can redistribute it and/or
  6.  * modify it under the terms of the GNU Library General Public
  7.  * License as published by the Free Software Foundation; either
  8.  * version 2 of the License, or (at your option) any later version.
  9.  *
  10.  * This library is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.  * Library General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU Library General Public License
  16.  * along with this library; see the file COPYING.LIB.  If not, write to
  17.  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  18.  * Boston, MA 02110-1301, USA.
  19.  */ 
  20.  
  21.  
  22. #ifndef _KSSLKEYGEN_H
  23. #define _KSSLKEYGEN_H
  24.  
  25. #include <qstring.h>
  26. #include <qstringlist.h>
  27. #include <kwizard.h>
  28.  
  29.  
  30. class KOpenSSLProxy;
  31. class KGWizardPage1;
  32. class KGWizardPage2;
  33.  
  34. /**
  35.  * KDE Key Generation dialog
  36.  *
  37.  * This is used to display a key generation dialog for cases such as the
  38.  * html \<keygen\> tag.  It also does the certificate signing request generation.
  39.  *
  40.  * @author George Staikos <staikos@kde.org>
  41.  * @see KSSL, KSSLCertificate, KSSLPKCS12
  42.  * @short KDE Key Generation Dialog
  43.  */
  44. class KIO_EXPORT KSSLKeyGen : public KWizard {
  45.     Q_OBJECT
  46. public:
  47.     /**
  48.      *  Construct a keygen dialog.
  49.      *  @param parent the parent widget
  50.      *  @param name the internal name of this instance
  51.      *  @param modal true if the dialog should be modal
  52.      */
  53.     KSSLKeyGen(QWidget *parent=0L, const char *name=0L, bool modal=false);
  54.  
  55.     /**
  56.      *  Destroy this dialog.
  57.      */
  58.     virtual ~KSSLKeyGen();
  59.  
  60.     /**
  61.      *  List the supported key sizes.
  62.      *  @return the supported key sizes
  63.      */
  64.     static QStringList supportedKeySizes();
  65.  
  66.     /**
  67.      *  Generate the certificate signing request.
  68.      *  @param name the name for the certificate
  69.      *  @param pass the password for the request
  70.      *  @param bits the bitsize for the key
  71.      *  @param e the value of the "e" parameter in RSA
  72.      *  @return 0 on success, non-zero on error
  73.      */
  74.     int generateCSR(const QString& name, const QString& pass, int bits, int e = 0x10001);
  75.  
  76.     /**
  77.      *  Set the key size.
  78.      *  @param idx an index into supportedKeySizes()
  79.      */
  80.     void setKeySize(int idx) { _idx = idx; }
  81.  
  82. private slots:
  83.     void slotPassChanged();
  84.     void slotGenerate();
  85.  
  86. private:
  87.     class KSSLKeyGenPrivate;
  88.     KSSLKeyGenPrivate *d;
  89.     int _idx;
  90.     KGWizardPage1 *page1;
  91.     KGWizardPage2 *page2;
  92. };
  93.  
  94. #endif
  95.  
  96.